/* 定义颜色变量 */
:root {
    /* 深色模式默认变量 */
    --bg-color: #121212;
    --text-color: #e0e0e0;
    --container-bg: #1a1a1a;
    --input-bg: #2d2d2d;
    --border-color: #3d3d3d;
    --primary-color: #c5a47e;
    --error-bg: #5a2e2e;
    --error-text: #ff9999;
    --button-bg: linear-gradient(135deg, #c5a47e 0%, #b08f6a 100%);
    --button-text: #1a1a1a;
    --button-hover-shadow: rgba(197, 164, 126, 0.3);
}

/* 白天模式变量覆盖 */
body.light-mode {
    --bg-color: #ffffff;
    --text-color: #374151;
    --container-bg: #ffffff; /* 改为纯白背景 */
    --border-color: #d1d5db; /* 更明显的边框颜色 */
    --input-bg: #ffffff;
    --primary-color: #4a6df1;
    --error-bg: #fee2e2;
    --error-text: #dc2626;
    --button-bg: linear-gradient(135deg, #4a6df1 0%, #3b82f6 100%);
    --button-text: #ffffff;
    --button-hover-shadow: rgba(74, 109, 241, 0.2);
}
body {
    background: var(--bg-color);
    color: var(--text-color);
    min-height: 100vh;
    margin: 0;
    padding: 2rem;
    font-family: system-ui, -apple-system, sans-serif;
    transition: background-color 0.3s ease;

}
/* 基础容器 */
.form-container {
    max-width: 600px;
    margin: 2rem auto;
    padding: 2rem;
    background: var(--container-bg);
    border: 1px solid var(--border-color); /* 新增边框 */
    box-shadow: 0 4px 16px rgba(0,0,0,0.1); /* 增强阴影 */
    border-radius: 12px;


}

/* 表单组 */
.form-group {
    display: flex;
    align-items: center;
    margin-bottom: 1.5rem;
    gap: 20px;
}

.form-group label {
    width: 120px;
    text-align: right;
    color: var(--primary-color);
    font-weight: 500;
    font-size: 0.95em;
}

/* 输入框样式 */
.form-group input {
    flex: 1;
    padding: 0.8rem;
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-color);
    transition: all 0.3s ease;
}

/* 只读字段 */
.form-group input[readonly] {
    background: color-mix(in srgb, var(--input-bg) 90%, #000);
    color: color-mix(in srgb, var(--text-color) 60%, #fff);
    cursor: not-allowed;
}

/* 聚焦状态 */
.form-group input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary-color) 20%, transparent);
    outline: none;
}

/* 提交按钮 */
button[type="submit"] {
    width: 100%;
    padding: 1rem;
    background: var(--button-bg);
    color: var(--button-text);
    border: none;
    border-radius: 6px;
    font-size: 1.1em;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 1rem;
}

button[type="submit"]:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px var(--button-hover-shadow);
}

/* 错误提示 */
.form-group.invalid label {
    color: var(--error-text);
}

.form-group.invalid input {
    border-color: var(--error-text);
    background: var(--error-bg);
}

.error-message {
    background: var(--error-bg);
    color: var(--error-text) !important;
    padding: 1rem;
    border-radius: 6px;
    border: 1px solid color-mix(in srgb, var(--error-text) 50%, transparent);
    margin: 1rem 0;
}
.button-group {
    display: flex;
    gap: 15px; /* 按钮间距 */
    margin-top: 20px;
}

button[type="submit"], .back-button {
    padding: 12px 25px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}
.back-button {
    background: var(--bg-input); /* 与输入框同色 */
    border: 1px solid var(--border-input); /* 与输入框同边框 */
    color: var(--text-primary);
}

.back-button:hover {
    background: var( --button-hover-shadow); /* 悬停效果 */
}
.action-buttons {
    display: flex;
    gap: 5px;
    margin-top: 32px;
}



.modern-back-button:hover {
    background: var(--button-hover-shadow);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.modern-back-button {
    display: inline-flex;
    align-items: center;
    padding: 3px 6px !important;  /* 减小内边距 */
    border-radius: 6px;
    background: var(--bg-input);
    border: 1px solid var(--border-input);
    color: var(--text-primary);
    text-decoration: none;
    font-size: 14px;  /* 缩小字体 */
    line-height: 1.2;
    margin: 10px 0;
}

.back-icon {
    width: 14px !important;  /* 缩小图标 */
    height: 14px !important;
    margin-right: 6px !important;
}

.primary-button {
    padding: 14px 36px;
    background: #007AFF;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.primary-button:hover {
    background: #0063CC;
    transform: translateY(-1px);
    box-shadow: 0 2px 12px rgba(0,122,255,0.3);
}

/* 响应式设计 */
@media (max-width: 576px) {
    .form-group {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .form-group label {
        text-align: left;
        width: auto;
    }

    .form-group input {
        width: 100%;
    }
}

    @media (max-width: 480px) {
        .action-buttons {
            flex-direction: column;
        }

        .modern-back-button,
        .primary-button {
            width: 100%;
            justify-content: center;
        }

}